package ${package.service.impl};

import ${package.mapper}.${table.mapper};
import ${package.model}.${table.entity};
import ${package.service}.${table.service};
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class ${table.serviceImpl} implements ${table.service} {

@Autowired
private ${table.mapper} ${table.lowerCaseEntity}Mapper;

@Override
public boolean save(${table.entity} entity) {
return ${table.lowerCaseEntity}Mapper.insert(entity) > 0;
}

@Override
public boolean updateById(${table.entity} entity) {
return ${table.lowerCaseEntity}Mapper.updateById(entity) > 0;
}

@Override
public boolean removeById(Long id) {
return ${table.lowerCaseEntity}Mapper.deleteById(id) > 0;
}

@Override
public ${table.entity} getById(Long id) {
return ${table.lowerCaseEntity}Mapper.selectById(id);
}

@Override
public List<${table.entity}> list() {
return ${table.lowerCaseEntity}Mapper.selectList(null);
}
}
